//package Junit.SearchEngine;
//
//import interfaces.SearchDataBase;
//import junit.framework.TestCase;
//import searchEngine.MapsIndex;
//import domain.items.Post;
//
//public class MapsIndexTest extends TestCase {
//
//	public void testAddNGetWordReference() {
//		SearchDataBase tIndexDB = new MapsIndex();
//		//a new word is being added, and also a new post
//		Post tPost1 = new Post(null, null, "testing1", "this post is used for testing");
//		tIndexDB.addWordReference("this", tPost1);
//		assertTrue(tIndexDB.getWordReference("this").size() == 1);
//		assertTrue(tIndexDB.getWordReference("this").get(0) == tPost1);
//		
//		//an existing word is being added, and a new post is added
//		Post tPost2 = new Post(null, null, "testing2", "this is another one, this also used for testing");
//		tIndexDB.addWordReference("this", tPost2);
//		assertTrue(tIndexDB.getWordReference("this").size() == 2);
//		assertTrue(tIndexDB.getWordReference("this").contains(tPost2));
//		assertTrue(tIndexDB.getWordReference("this").contains(tPost1));
//		
//		//an existing word is added, and an existing post is added
//		tIndexDB.addWordReference("this", tPost2);
//		assertTrue(tIndexDB.getWordReference("this").size() == 2);
//		assertTrue(tIndexDB.getWordReference("this").contains(tPost2));
//		assertTrue(tIndexDB.getWordReference("this").contains(tPost1));
//				
//		//a new word is added, but with an existing post
//		tIndexDB.addWordReference("used", tPost1);
//		assertTrue(tIndexDB.getWordReference("used").size() == 1);
//		assertTrue(tIndexDB.getWordReference("used").get(0) == tPost1);
//		
//		//an existing word is added, and an existing post is added, but the post doesn't reference that word
//		tIndexDB.addWordReference("used", tPost2);
//		assertTrue(tIndexDB.getWordReference("used").size() == 2);
//		assertTrue(tIndexDB.getWordReference("used").contains(tPost2));
//		assertTrue(tIndexDB.getWordReference("used").contains(tPost1));
//		
//		//search for a word that doesn't exist
//		assertTrue(tIndexDB.getWordReference("abcdefghijklmnopqrstuvwxyz").isEmpty());
//
//	}
//
//}
